/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-30
 * Time:20:32
 */
public class Test {
    private static String userName = "admin";
    private static String password = "123456";

    public static void main(String[] args) {
        try {
            login("admin", "123456");
        } catch (AnimalException kk) {
            kk.printStackTrace();
        }
    }

    public static void login(String userName, String password) throws AnimalException{
        if (!Test.userName.equals(userName)) {
            throw new AnimalException("用户名错误");
        }

        System.out.println("代码结束");
    }
}
